//
//  Present.m
//  TableViewDataSource
//
//  Created by hibo on 2019/6/10.
//  Copyright © 2019 hibo. All rights reserved.
//

#import "Present.h"
#import "Model.h"

@implementation Present
-(instancetype)init{
    self = [super init];
    if (self) {
        [self loadData];
    }
    return self;
}
-(NSMutableArray *)dataArr{
    if (_dataArr==nil) {
        _dataArr = [NSMutableArray array];
    }
    return _dataArr;
}
-(void)loadData{
    NSArray *array = @[@{@"title":@"yahibo",@"num":@"99"},
                       @{@"title":@"yahibo",@"num":@"99"},
                       @{@"title":@"yahibo",@"num":@"99"},
                       @{@"title":@"yahibo",@"num":@"99"},
                       @{@"title":@"yahibo",@"num":@"99"}];
    for (id obj in array) {
        Model *model = [[Model alloc] init];
        model.name = obj[@"title"];
        model.num = obj[@"num"];
        [self.dataArr addObject:model];
    }
}
@end
